//
//  AlertViewTopView.m
//  DianDangDai
//
//  Created by bhf on 2017/12/18.
//  Copyright © 2017年 bhf. All rights reserved.
//

#import "AlertViewTopView.h"

@implementation AlertViewTopView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupViews];
    }
    return self;
}

- (void)setupViews {
    self.backgroundColor = [UIColor clearColor];
    UIView *bgview = [[UIView alloc] initWithFrame:CGRectMake(45, 24, 180, 180)];
    bgview.backgroundColor = [UIColor whiteColor];
    
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 270, 262)];
    view.layer.cornerRadius = 10;
    view.backgroundColor = [UIColor colorWithHex:@"#ed476c"];
    [self addSubview:view];
    
    UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(view.frame)-10, 270, 12)];
    
    view2.backgroundColor = [UIColor colorWithHex:@"#ed476c"];
    [self addSubview:view2];
    
    
    _imageView = [[UIImageView alloc] init];
    _imageView.frame = CGRectMake(16, 16, 148, 148);
    _imageView.image = [UIImage imageNamed:@"QRCode.jpeg"];
    [bgview addSubview:_imageView];
    
    UILabel *lab = [[UILabel alloc] init];
    lab.text = @"扫一扫立即体验典当贷平台";
    lab.textAlignment = NSTextAlignmentCenter;
    lab.textColor = [UIColor whiteColor];
    lab.frame = CGRectMake(59, CGRectGetMaxY(bgview.frame)+12, 150, 14);
    lab.font = [UIFont systemFontOfSize:12];
    [self addSubview:bgview];
    [self addSubview:lab];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
